# coding:utf-8
import json
str_headers = """
basisPenalty: 
basisPunishment: 
behaviorType: 100
conditionDeclare: 
disCreditField: 151
identityNo: 420107197705027538
identityType: 135
name: 杜志豪
occurTime: 2019-06-21T09:26:06.000Z
penaltyMeasureIdList: [613, 611]
publishName: 1
publishType: 10
punishTime: 

"""


list_headers = str_headers.split('\n')
dict_headers = dict()
for headers in list_headers:
    dict_headers[headers.split(':')[0]] = headers.split(":")[1]
print(json.dumps(dict_headers))



